package cn.ml.chuji.oop.zuChe;

public class Car extends MotoVehicle{
    //型号
    private String type;



    @Override
    public float zuJin(int days) {
        float price = this.getRiZuJin() * days;
        if(days >7 && days<=30){
            price = 0.9f*price;
        }else if(days>=30 && days <= 150){
            price *= 0.8f;
        }else if(days > 150){
            price *= 0.7f;
        }
        return price;
    }


    public Car() {
    }

    public Car(String ID, String brand, int riZuJin, String type) {
        super(ID, brand, riZuJin);
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
    @Override
    public String toString() {

        return "Car{" +
                "ID='" + super.getID() + '\'' +
                ", brand='" + super.getBrand() + '\'' +
                ", riZuJin=" + this.getRiZuJin() + '\'' +
                ", type='" + type + '\'' +
                '}';
    }
}
